package astudy.bytecode;

import java.util.ArrayList;
import java.util.List;

public class MethodFilter {

	private NamePattern classNamePattern;
	private NamePattern methodNamePattern;
	private List<ClassFileWrapper> wrappers = new ArrayList<ClassFileWrapper>();
	
	public MethodFilter() {
	}
	
	public MethodFilter(String classNamePattern, 
			String methodNamePattern, ClassFileWrapper[] wrappers) {

		this.classNamePattern = new NamePattern(classNamePattern);
		this.methodNamePattern = new NamePattern(methodNamePattern);
		if (wrappers != null) {
			for (ClassFileWrapper w: wrappers) {
				this.wrappers.add(w);
			}
		}
	}

	public NamePattern getClassNamePattern() {
		return classNamePattern;
	}
	public void setClassNamePattern(NamePattern classNamePattern) {
		this.classNamePattern = classNamePattern;
	}
	public NamePattern getMethodNamePattern() {
		return methodNamePattern;
	}
	public void setMethodNamePattern(NamePattern methodNamePattern) {
		this.methodNamePattern = methodNamePattern;
	}
	public List<ClassFileWrapper> getWrappers() {
		return wrappers;
	}
	public void setWrappers(List<ClassFileWrapper> wrappers) {
		this.wrappers = wrappers;
	}
	public void appendWrapper(ClassFileWrapper wrapper) {
		this.wrappers.add(wrapper);
	}
}
